package com.zz.services.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zz.dao.BannerDao;
import com.zz.domain.Banner;
import com.zz.services.BannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class BannerServiceImpl  implements BannerService {
    @Autowired
    BannerDao bannerDao ;


    @Override
    public PageInfo<Banner> getIndexBanner() {
        PageHelper.startPage(1,3);
        Map<String,Object> map = new HashMap<>();
        map.put("flag",1);
        List<Banner> banners = bannerDao.findBannerByCondition(map);
        PageInfo<Banner> bannerPageInfo = new PageInfo<>(banners);
        return  bannerPageInfo ;
    }
}
